{% extends "xadmin/views/model_form.html" %}
{% load i18n %}
{% load url from future %}
{% load xadmin_tags %}
{% load crispy_forms_tags %}

{% block breadcrumbs %}
{% if account_view %}
<ul class="breadcrumb">
  <li><a href="{% url 'admin:index' %}">{% trans 'Home' %}</a> <span class="divider">/</span></li>
  <li class="active">{% trans 'Change password' %}</li>
</ul>
{% else %}
<ul class="breadcrumb">
  <li><a href="{% url 'admin:index' %}">{% trans 'Home' %}</a> <span class="divider">/</span></li>
  <li>
    {% if has_view_permission %}
    <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst }}</a>
    {% else %}{{ opts.verbose_name_plural|capfirst }}{% endif %} <span class="divider">/</span>
  </li>
  <li><a href="{% url opts|admin_urlname:'change' original.pk %}">{{ original|truncatewords:"18" }}</a> <span class="divider">/</span></li>
  <li class="active">{% trans 'Change password' %}</li>
</ul>
{% endif %}
{% endblock %}

{% block content %}
<form action="{{ form_url }}" method="post" id="{{ opts.module_name }}_form">{% csrf_token %}{% block form_top %}{% endblock %}
<div>
  {% if errors %}
      <p class="text-error">
      {% blocktrans count counter=errors|length %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %}
      </p>
      {{ form.non_field_errors }}
  {% endif %}

  <div class="alert alert-info">
    {% if account_view %}
    {% trans "Enter your new password." %}
    {% else %}
    {% blocktrans with username=original.username %}Enter a new password for the user <strong>{{ username }}</strong>.{% endblocktrans %}
    {% endif %}
  </div>

  {% crispy form %}

  <div class="form-actions">
  <input class="btn btn-primary" type="submit" value="{% trans 'Change password' %}" class="default" />
  </div>

<script type="text/javascript">document.getElementById("id_password1").focus();</script>
</div>
</form>
{% endblock %}
